import 'package:flutter/material.dart';
import 'package:flutter_color_plugin/flutter_color_plugin.dart';

/**
 * StatelessWidget与基础组件
 */
class LessGroupPage extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'StatelessWidget与基础组件',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(title: Text('StatelessWidget与基础组件'), backgroundColor: ColorUtil.color("#fe45dd"),
        leading: GestureDetector(
          onTap: (){
              Navigator.pop(context);
          },
          child: Icon(Icons.arrow_back),
        ),),
        body: Container(
          decoration: BoxDecoration(color: Colors.grey),
          alignment: Alignment.center,
          child: Column(
            children: <Widget>[
              Text(
                '这是一个 Text 组件',
                style: TextStyle(fontSize: 24),
              ),
              Icon(Icons.accessibility, size:50, color: Colors.deepOrange),
              CloseButton(),
              BackButton(),
              Chip(
                label: Text('这是一个 Chip 组件'),
                avatar: Icon(Icons.print),
              ),
              Divider(height: 10, thickness: 10, color: Colors.amber, indent: 20, endIndent: 30), //分隔线
              Card(
                color: Colors.blue,
                elevation: 5, //阴影
                margin: EdgeInsets.all(20),
                child: Container(
                  padding: EdgeInsets.all(15),
                  child: Text(
                    '我是 Card 组件',
                    style: TextStyle(color: Colors.deepOrange),
                  ),
                ),
              ),
              AlertDialog(
                title: Text('盘他'),
                content: Text('2020年 内疚，自责'),
              ),
            ],
          ),
        ),
      )
    );
  }
}